<?php
require('include/init.php');
require('include/pagenavigator.php');
$pagesize = 12;
$page = $_GET['page'] ? $_GET['page'] : 1;
$start = ($page-1) * $pagesize;
$cate_id = $_GET['cate_id'] ? $_GET['cate_id'] : 0;
$where = '1=1';
$product_list = $GLOBALS['db']->getAll("select * from kyz_products where {$where} limit $start, $pagesize");		
$total = $GLOBALS['db']->getOne("select count(*) from kyz_products where {$where}");
$pagenavigator = new PageNavigator(array('total' => $total, 'currentPage' => $page, 'pageSize' => $pagesize, 'pageTemplate' => "product----------$cate_id----------{page}.html#chanpin",'url'=>''));		
$smarty->assign('pagenavigator', $pagenavigator);
$smarty->assign('product_list', $product_list);
$smarty->assign('products', get_products());
$smarty->display('product.html');


?>